
<div id="layout_main_top">

</div>
<div id="layout_main">


{if !isset($errormessage)}


<form action="index.php?page=raids" method="post">
<INPUT TYPE=HIDDEN NAME="action" value="save">
<INPUT TYPE=HIDDEN NAME="raid_id" value={$edit_raid.raid_id}>
  <table id="small_table" cellspacing='0'>
    <tr class="menu_header">
  	<th colspan='3'>
  	Edit raid
  	</th>
  	</tr>

  	<tr class="row_1">
	<td colspan='3' class="staticboldcenter">
	Please insert the following information:<br><span class="error">{$errormessage}</span><br>
	</td>
	</tr>
  	<tr class="row_1">
		<td class="staticboldright">
		<br>
		</td>
		<td class="autonormaltop">
		<br>
		</td>
		<td class="autonormaltopright" width="16px">
		<br>
		</td>
	</tr>
  	<tr class="row_1">
		<td class="staticboldright">
			Location:

			{if isset($event_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$event_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
		<td class="autonormalcenter">
			{html_options options=$events name="event" class="large" selected=$edit_raid.event_id}
		</td>
		<td class="autonormal">
			{if isset($event_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$event_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
			Date:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="datetime" class="text" name="date" value="{$edit_raid.date_time}">
			<button id="trigger">...</button>
		</td>
		<td class="autonormal">
			{if isset($date_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$date_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left"{popup text="The freeze time is the number of hours before the raid starts when the raid gets 'frozen'.<br>This means that Main players cannot unsign a couple of hours before raid start.<br>Use this to make sure players will get -RP when not showing up."  center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>Freeze time:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="freeze_time" class="smalltext" name="freeze_time" value="{$edit_raid.freeze_time}"> Hour(s)
		</td>
		<td class="autonormal">
			{if isset($freezetime_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$freeze_time_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		Leader:
		</td>
		<td class="autonormalcenter">
			{html_options options=$players name="leader" class="large" selected=$edit_raid.leader_player_id}
		</td>
		<td class="autonormal">
			{if isset($leader_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$leader_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		Maintank 1:
		</td>
		<td class="autonormalcenter">
			{html_options options=$warriors name="mt1" class="large" selected=$edit_raid.mt1_player_id}
		</td>
		</td>
		<td class="autonormal">
			{if isset($maintank1_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$maintank1_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		Maintank 2:
		</td>
		<td class="autonormalcenter">
			{html_options options=$warriors name="mt2" class="large" selected=$edit_raid.mt2_player_id}
		</td>
		<td class="autonormal">
			{if isset($maintank2_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$maintank2_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
			Signup Limit:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="signuplimit" class="smalltext" name="mainlimit" value="{$edit_raid.no_players}">
		</td>
		<td class="autonormal">
			{if isset($mainlimit_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$mainlimit_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
			Sub Limit:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="signuplimit" class="smalltext" name="sublimit" value="{$edit_raid.substitute_max}">
		</td>
		<td class="autonormal">
			{if isset($sublimit_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$sublimit_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
						<tr class="row_1">
					<td class="staticright">
						
					</td>
					<td class="autonormalcenter" colspan="2">
						<hr>
					</td>
				</tr>
			{foreach name=roles item=role from=$roles}
				<tr class="row_1">
					<td class="staticboldright">
						<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left"{popup text="The number of this main role that are allowed. If a players class role is full, he can only sign up for the Main role's. (ie. if a protection paladin's spots are full, the prot pala can only sign up for the /"General/" tank spot" center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
						{$role.role_name}
					</td>
					<td class="autonormalcenter">
						<input type="text" id="{$assigned_raid_roles[$class_role.class_role_name].id|default:0}" class="smalltext" name="{$assigned_raid_roles[$class_role.class_role_name].id|default:0}" value="{$assigned_raid_roles[$role.role_name].value|default:0}"> <br>
					</td>
					<td class="autonormal">
						
					</td>
				</tr>
				{foreach name=class_roles item=class_role from=$role.class_roles}
				<tr class="row_1">
					<td class="staticright">
						{$class_role.class_role_name}
					</td>
					<td class="autonormalcenter">
						<input type="text" id="{$assigned_raid_roles[$class_role.class_role_name].id|default:0}" class="smalltext" name="{$assigned_raid_roles[$class_role.class_role_name].id|default:0}" value="{$assigned_raid_roles[$class_role.class_role_name].value|default:0}"> <br>						
					</td>
					<td class="autonormal">
						
					</td>
				</tr>
				{/foreach}
				<tr class="row_1">
					<td class="staticright">
						
					</td>
					<td class="autonormalcenter" colspan="2">
						<hr>
					</td>
				</tr>
			{/foreach}
	<tr class="row_1">
		<td class="staticboldright">
			<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left"{popup text="The minimum Main Team is the team that is allowed to sign up as a main.<br>All teams above this one automaticly gain Main rights as well."  center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>Min. Main Team:
		</td>
		<td class="autonormalcenter">
			{html_options options=$teams name="mainteam" class="large" selected=$edit_raid.main_team_id}
		</td>
		<td class="autonormal">
			{if isset($mainteam_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$mainteam_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left" {popup text="The minimum Sub Team is the team that is allowed to sign up as a sub.<br>All teams <b>above</b> this one automaticly gain Sub rights as well.<br>All teams <b>below</b> this team will not be allowed to signup at all!"  center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>Min. Sub Team:
		</td>
		<td class="autonormalcenter">
			{html_options options=$teams name="subteam" class="large" selected=$edit_raid.sub_team_id}
		</td>
		<td class="autonormal">
			{if isset($subteam_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$subteam_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		RP Usage:
		</td>
		<td class="autonormalcenter">

		<select name="rp_category_id" class="large">
			{foreach name=categories item=category from=$rp_categories}
				<option value="{$category.category_id}" {if $edit_raid.rp_category_id eq $category.category_id}SELECTED{/if}>{$category.category_long_name} RP</option>
			{/foreach}
		</select>
		</td>
		<td class="autonormal">
			{if isset($rp_category_id)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$subteam_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright" valign="top">
		Description:
		</td>
		<td class="autonormalcenter" rowspan="3">
		<textarea rows="2" cols="20" name="comment">{$edit_raid.description}</textarea>
		</td>
		<td class="autonormal">
		&nbsp;
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		</td>
		<td class="autonormal">
		&nbsp;
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		</td>
		<td class="autonormal">
		&nbsp;
		</td>
	</tr>
  	<tr class="row_1">
		<td class="staticboldright">
		<br>
		</td>
		<td class="autonormalbottom">
		<br>
		</td>
		<td class="autonormalbottomright">
		&nbsp;
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldcenter" colspan="3">
		<br>
		<input name="newraid" type="submit" value="save raid">
		</td>
	</tr>

 </table>
</form>

{dhtml_calendar inputField="datetime" button="trigger" singleClick=false showsTime=true timeFormat="24" ifFormat="%Y-%m-%d - %H:%M"}

{else}



<DIV class="MenuHead">
Succesfull!
</DIV>

<DIV class="MenuText">
{$message}
</DIV>




{/if}

</div>
<div id="layout_main_bottom">

</div>
